mod model;
mod render;
use crate::{model::MoonModel, render::MoonRender};
use log::info;
use std::error::Error;
use tge::game::Game;
use tge::log::init_log;
use tge::audio::Audio;

fn main() -> Result<(), Box<dyn Error>> {
    init_log(log::LevelFilter::Info, "log/moon.log");
    info!("Moon(tge.rs) start...");
    let ad = Audio::new();
    ad.play_file("assets/moon/back.mp3", true);
    let mut m = MoonModel::new();
    let mut r = MoonRender::new();
    let mut g = Game::new(&mut m, &mut r);
    g.init();
    g.run()?;
    g.render.term.reset(&mut g.context);
    Ok(())
}
